import http from '../../../utils/request/request'

// 删除证书（单个）
export function deleCertificate(data) {
    return http({
        url: `/breed/certificate/${data}`,
        method: 'delete'
    })
}

// 删除证书（批量）
export function deleSomeCertificate(data) {
    return http({
        url: `/breed/certificate/batch?ids=${data}`,
        method: 'delete'
    })
}

// 查询所有预警供应商证书
export function getCertificate(data) {
    return http({
        url: `/breed/certificate/${data.page}/${data.size}`,
        method: 'get'
    })
}

// 修改证书
export function alterCertificateData(data) {
    return http({
        url: `/breed/certificate`,
        method: 'put',
        data
    })
}

// 通过公司名模糊搜索
export function searchByName(data) {
    return http({
        url: `/breed/certificate/${data.page}/${data.size}/${data.keyWord}`,
        method: 'get',
    })
}

// 通过预警类型和到期时间查询证书
export function searchByDateAndType(data) {
    return http({
        url: `/breed/certificate/option/${data.page}/${data.size}?nums=${data.nums}&type=${data.type}`,
        method: 'get',
    })
}

// 导出为 EXCEL
export function exportToExcel(data) {
    return http({
        url: `/breed/certificate/excel/${data}`,
        method: 'get',
    })
}